-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an edit deployment API #2515
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor changes, and then lgtm
existing: DeploymentId, | ||
}, | ||
#[error("an update deployment operation must provide an endpoint with the same services and handlers. The update tried to remove the services {0:?}")] | ||
#[code(restate_errors::META0006)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would define a new error code for errors related to update. META0006 seems wrong as it talks about adding deployments. In the error code you can describe in a more lengthy manner what to do
pub fn update_deployment( | ||
&mut self, | ||
deployment_id: DeploymentId, | ||
deployment_metadata: DeploymentMetadata, | ||
services: Vec<endpoint_manifest::Service>, | ||
) -> Result<(), SchemaError> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's me, but I couldn't find a check that verifies the supported service protocol range is the same. This is definitely the most important thing to check, as there is a super high change that if they don't match, the invocation will get broken/corrupted.
let handlers = DiscoveredHandlerMetadata::compute_handlers( | ||
service | ||
.handlers | ||
.into_iter() | ||
.map(|h| { | ||
DiscoveredHandlerMetadata::from_schema( | ||
service_name.as_ref(), | ||
service_type, | ||
h, | ||
) | ||
}) | ||
.collect::<Result<Vec<_>, _>>()?, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're missing somewhere to preserve the private handler flag? Maybe add a unit test to check that.
Adds an alternative to force which allows you to update an existing deployment ID to have a new arn/uri/etc, including adding services and handlers if necessary. For break glass operations to get you out of a jam with failing invocations.
We do allow this operation to move existing deployments to point to the same URI as other deployments, an invariant we previously kept. However, in this case, we will not allow further force deploys against that URI until some deployments are removed to make it unambigious which deployment ID the force should subsume
The recommended workflow is as follows:
If you notice failing invocations after you've already deployed some other change, because the previous deployment hasn't drained, the workflow is as follows: